package com.uobgroup.ews.uam.core.domain;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.springframework.beans.factory.annotation.Configurable;

@Entity
@Configurable
public class AccessToStaff extends BaseEntity implements SecurityGroupAware {

   @NotNull
   @Size(max = 64)
   private String name;

   @Size(max = 255)
   private String description;

   @OneToOne(cascade = CascadeType.PERSIST)
   private SecurityGroup securityGroup;

   @Id
   @GeneratedValue(strategy = GenerationType.AUTO)
   @Column(name = "id")
   private Long id;

   public Long getId() {
      return this.id;
   }

   public void setId(Long id) {
      this.id = id;
   }

   public String getName() {
      return this.name;
   }

   public void setName(String name) {
      this.name = name;
   }

   public String getDescription() {
      return this.description;
   }

   public void setDescription(String description) {
      this.description = description;
   }

   public SecurityGroup getSecurityGroup() {
      return this.securityGroup;
   }

   public void setSecurityGroup(SecurityGroup securityGroup) {
      this.securityGroup = securityGroup;
   }

   @Override
   public String getSecurityGroupName() {
      return name;
   }

   @Override
   public String getParentGroupName() {
      return "accesstostaff";
   }
}
